
package com.epam.edu.task03.dances;

import javax.xml.bind.annotation.*;
import java.util.LinkedList;
import java.util.List;


/**
 * <p>Java class for Dance complex type.
 * <p/>
 * <p>The following schema fragment specifies the expected content contained within this class.
 * <p/>
 * <pre>
 * &lt;complexType name="Dance">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="type" type="{Dance}DanceType"/>
 *         &lt;element name="scene" type="{Dance}SceneType"/>
 *         &lt;element name="numberOfDancers" type="{Dance}NumberOfDancersType"/>
 *         &lt;element name="music" type="{Dance}MusicType"/>
 *         &lt;element name="dancers">
 *           &lt;complexType>
 *             &lt;complexContent>
 *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 &lt;sequence>
 *                   &lt;element name="dancer" type="{Dance}Dancer" maxOccurs="unbounded"/>
 *                 &lt;/sequence>
 *               &lt;/restriction>
 *             &lt;/complexContent>
 *           &lt;/complexType>
 *         &lt;/element>
 *         &lt;element name="number" type="{http://www.w3.org/2001/XMLSchema}integer"/>
 *       &lt;/sequence>
 *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Dance", namespace = "Dance", propOrder = {
        "type",
        "scene",
        "numberOfDancers",
        "music",
        "dancers",
        "number"
})
public class Dance {

    @XmlElement(namespace = "Dance", required = true)
    protected DanceType type;
    @XmlElement(namespace = "Dance", required = true)
    protected SceneType scene;
    @XmlElement(namespace = "Dance", required = true)
    protected NumberOfDancersType numberOfDancers;
    @XmlElement(namespace = "Dance", required = true)
    protected MusicType music;
    @XmlElement(namespace = "Dance", required = true)
    protected int number;
    @XmlAttribute(name = "danceName", required = true)
    protected String danceName;
    @XmlElement(namespace = "Dance", required = true)
    private List<Dancer> dancers = new LinkedList<Dancer>();

    /**
     * Gets the value of the type property.
     *
     * @return possible object is
     *         {@link DanceType }
     */
    public DanceType getType() {
        return type;
    }

    /**
     * Sets the value of the type property.
     *
     * @param value allowed object is
     *              {@link DanceType }
     */
    public void setType(DanceType value) {
        this.type = value;
    }

    /**
     * Gets the value of the scene property.
     *
     * @return possible object is
     *         {@link SceneType }
     */
    public SceneType getScene() {
        return scene;
    }

    /**
     * Sets the value of the scene property.
     *
     * @param value allowed object is
     *              {@link SceneType }
     */
    public void setScene(SceneType value) {
        this.scene = value;
    }

    /**
     * Gets the value of the numberOfDancers property.
     *
     * @return possible object is
     *         {@link NumberOfDancersType }
     */
    public NumberOfDancersType getNumberOfDancers() {
        return numberOfDancers;
    }

    /**
     * Sets the value of the numberOfDancers property.
     *
     * @param value allowed object is
     *              {@link NumberOfDancersType }
     */
    public void setNumberOfDancers(NumberOfDancersType value) {
        this.numberOfDancers = value;
    }

    /**
     * Gets the value of the music property.
     *
     * @return possible object is
     *         {@link MusicType }
     */
    public MusicType getMusic() {
        return music;
    }

    /**
     * Sets the value of the music property.
     *
     * @param value allowed object is
     *              {@link MusicType }
     */
    public void setMusic(MusicType value) {
        this.music = value;
    }

    /**
     * Gets the value of the number property.
     *
     * @return possible object is
     *         {@link int }
     */
    public int getNumber() {
        return number;
    }

    /**
     * Sets the value of the number property.
     *
     * @param value allowed object is
     *              {@link int }
     */
    public void setNumber(int value) {
        this.number = value;
    }

    /**
     * Gets the value of the name property.
     *
     * @return possible object is
     *         {@link String }
     */
    public String getDanceName() {
        return danceName;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value allowed object is
     *              {@link String }
     */
    public void setDanceName(String value) {
        this.danceName = value;
    }

    public List<Dancer> getDancers() {
        return dancers;
    }

    public void setDancers(List<Dancer> dancers) {
        this.dancers = dancers;
    }

    @Override
    public String toString() {
        return "Dance{" +
                "type=" + type +
                ", scene=" + scene +
                ", numberOfDancers=" + numberOfDancers +
                ", music=" + music +
                ", number=" + number +
                ", danceName='" + danceName + '\'' +
                ", dancers=" + getDancerList() +
                '}';
    }

    public String getDancerList() {
        StringBuilder dancerList = new StringBuilder();
        for (Dancer dancer : this.dancers) {
            dancerList.append(dancer.toString());
        }
        return dancerList.toString();
    }
}
